using System;
using Castle.ActiveRecord;

namespace IronMis2.Models
{
    [ActiveRecord("other_in")]
    public class OtherIn:ActiveRecordBase<OtherIn>
    {
        private Guid id;
        private string otherInId;
        private string otherInType;
        private DateTime? otherIndDate;
        private Employee employee;
        private Storehouse storeHouse;

        [PrimaryKey(PrimaryKeyType.GuidComb,Column = "id")]
        public Guid Id
        {
            set { id = value; }
            get { return id; }
        }

        [Property(Column = "other_in_id",SqlType = "char",Length = 10)]
        public string OtherInId
        {
            set { otherInId = value; }
            get { return otherInId; }
        }

        [Property(Column = "other_in_type",SqlType = "char",Length = 20)]
        public string OtherInType
        {
            set { otherInType = value; }
            get { return otherInType; }
        }

        [Property(Column = "other_in_date",SqlType = "datetime",Length = 8)]
        public DateTime? OtherInDate
        {
            set { otherIndDate = value; }
            get { return otherIndDate; }
        }

        [BelongsTo(Column = "s_number",ForeignKey = "id",Insert = true,Update = true,Fetch = FetchEnum.Select)]
        public Employee Employee
        {
            set { employee = value; }
            get { return employee; }
        }

        [BelongsTo(Column = "stor_in",ForeignKey = "id",Insert = true,Update = true,Fetch = FetchEnum.Select)]
        public Storehouse StoreHouse
        {
            set { storeHouse = value; }
            get { return storeHouse; }
        }
    }
}
